package com.binvshe.binvshe;

import android.app.Application;
import android.content.Context;
import android.test.ApplicationTestCase;

import com.binvshe.binvshe.app.MyApplication;
import com.binvshe.binvshe.common.http.DataRequestListener;
import com.binvshe.binvshe.common.http.MyHttpRequest;
import com.binvshe.binvshe.common.http.UrlCenter;
import com.pachong.android.framework.httprequest.IHttpRequest;
import com.pachong.android.framework.httprequest.UrlParams;

/**
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }

    public void getOpusList()
    {
        IHttpRequest request=new MyHttpRequest(getContext());
        UrlParams params=new UrlParams();
        params.put("page",1+"");
        params.put("size",2+"");
        request.get(UrlCenter.GET_OPUS, params, new DataRequestListener<String>(String.class) {
            @Override
            public void onStart(Context context, String url) {
                super.onStart(context, url);
            }

            @Override
            public void onSuccess(String o) {
                super.onSuccess(o);
            }

            @Override
            public void onFailure(Throwable t, int errorNo, String strMsg) {
                super.onFailure(t, errorNo, strMsg);
            }
        });
    }
}